 //**************************************************
 // PairOfDice.java   Author:20172323wyh
 //**************************************************
 public class PairOfDice
 {
    Die die1 = new Die();
    Die die2 = new Die();
    
    private int totalvalue;//Total value of the two dies.
    private int facevalue1;//facevalue of the die1.
    private int facevalue2;//facevalue of the die2.   

    public PairOfDice()
    {
       totalvalue = die1.getFaceValue() + die2.getFaceValue();  
    }
  
    public int getFacevalue1()
    {
       facevalue1 = die1.getFaceValue();
       return facevalue1;
    }

    public void setFacevalue1(int value)
    {
       die1.setFaceValue(value);
       facevalue1 = value;
    }

    public int getFacevalue2()
    {
       facevalue2 = die2.getFaceValue();
       return facevalue2;
    }
    
    public void setFacevalue2(int value)
    {
       die2.setFaceValue(value);
       facevalue2 =value;
    }

    public void Roll()
    {
       die1.roll();
       die2.roll();
    }
       
    public int getTotal()
    {
       facevalue1 = die1.getFaceValue();
       facevalue2 = die2.getFaceValue();
       totalvalue = facevalue1 + facevalue2;
       return totalvalue;
    }
 }
